using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

using FreeFlow.Client;

namespace FreeFlow.WinFormsControls
{
	/// <summary>
	/// Base class for list based controls.
	/// </summary>
	public class Grid : ConnectableControl
	{
    /// <summary>Grid control displaying the list.</summary>
    internal System.Windows.Forms.DataGrid dataGrid;
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

    /// <summary>
    /// Creates a new <see cref="Grid"/> instance.
    /// </summary>
		public Grid()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();
		}

    internal static DataGridTextBoxColumn CreateColumn(string colName, string caption)
    {
      DataGridTextBoxColumn textColumn = new DataGridTextBoxColumn();
      textColumn.MappingName = colName;
      textColumn.HeaderText = caption;
      textColumn.ReadOnly = true;
      textColumn.Width = 120;
      return textColumn;
    }

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
      this.dataGrid = new System.Windows.Forms.DataGrid();
      ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
      this.SuspendLayout();
      // 
      // dataGrid
      // 
      this.dataGrid.AlternatingBackColor = System.Drawing.Color.LightCyan;
      this.dataGrid.BackColor = System.Drawing.Color.White;
      this.dataGrid.DataMember = "";
      this.dataGrid.Dock = System.Windows.Forms.DockStyle.Fill;
      this.dataGrid.FlatMode = true;
      this.dataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
      this.dataGrid.Location = new System.Drawing.Point(0, 0);
      this.dataGrid.Name = "dataGrid";
      this.dataGrid.ReadOnly = true;
      this.dataGrid.Size = new System.Drawing.Size(528, 304);
      this.dataGrid.TabIndex = 0;
      // 
      // Grid
      // 
      this.Controls.Add(this.dataGrid);
      this.Name = "Grid";
      this.Size = new System.Drawing.Size(528, 304);
      ((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
      this.ResumeLayout(false);

    }
		#endregion
	}
}
